local skill = fk.CreateSkill {
  name = "#VirtualEquip_Skill",
}

---@class Utility_LB_Kill
local LB_U = require "packages.lb_kill_utility._base"

local eight_diagram_on_use = function (self, event, target, player, data)
  local room = player.room
  room:broadcastPlaySound("./packages/standard_cards/audio/card/eight_diagram")
  room:setEmotion(player, "./packages/standard_cards/image/anim/eight_diagram")
  local skill = Fk.skills["#eight_diagram_skill"] ---@type TriggerSkill
  skill:use(event, target, player, data)
end
skill:addEffect(fk.AskForCardUse, {
  can_trigger = function(self, event, target, player, data)
    return target == player and not player:hasSkill("#eight_diagram_skill", true) and
      Exppattern:Parse(data.pattern):matchExp("jink|0|nosuit|none") and
      not player:prohibitUse(Fk:cloneCard("jink"))
      and LB_U.hasVirtualEquip(player, "eight_diagram")
      and Fk.skills["#eight_diagram_skill"] ~= nil and Fk.skills["#eight_diagram_skill"]:isEffectable(player)
  end,
  on_cost = function (self, event, target, player, data)
    if  player.room:askToSkillInvoke(player, {
      skill_name = "eight_diagram",
    }) then
      eight_diagram_on_use(self, event, target, player, data)
    end
  end,
})
skill:addEffect(fk.AskForCardResponse, {
  can_trigger = function(self, event, target, player, data)
    return target == player and not player:hasSkill("#eight_diagram_skill") and
      Exppattern:Parse(data.pattern):matchExp("jink|0|nosuit|none") and
      not player:prohibitResponse(Fk:cloneCard("jink"))
      and LB_U.hasVirtualEquip(player, "eight_diagram")
      and Fk.skills["#eight_diagram_skill"] ~= nil and Fk.skills["#eight_diagram_skill"]:isEffectable(player)
  end,
  on_cost = function (self, event, target, player, data)
    if  player.room:askToSkillInvoke(player, {
      skill_name = "eight_diagram",
    }) then
      eight_diagram_on_use(self, event, target, player, data)
    end
  end,
})


return skill
